package cn.juque.workflow.api.provider;

import cn.juque.common.base.BaseResponseDTO;
import cn.juque.workflow.api.dto.processinfo.ProcessInstanceDeleteDTO;
import cn.juque.workflow.api.dto.taskinfo.*;

import java.util.List;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>ITaskInfoProvider</li>
 * </ul>
 * @date 2023-01-30 10:53:29
 **/
public interface ITaskInfoProvider {

    /**
     * 查询代办任务
     * @param searchDTO 条件
     * @return BaseResponseDTO
     */
    BaseResponseDTO<List<TaskInfoListDTO>> listTodo(ListTodoTaskSearchDTO searchDTO);

    /**
     * 查询已完成的任务
     * @param searchDTO 条件
     * @return BaseResponseDTO
     */
    BaseResponseDTO<List<TaskInfoListDTO>> listFinish(ListFinishTaskSearchDTO searchDTO);

    /**
     * 查询可认领的任务
     * @param searchDTO 条件
     * @return BaseResponseDTO
     */
    BaseResponseDTO<List<TaskInfoListDTO>> listByClaim(ListClaimTaskSearchDTO searchDTO);

    /**
     * 详情
     * @param searchDTO ProcessInstanceDetailSearchDTO
     * @return ProcessInstanceDetailDTO
     */
    BaseResponseDTO<ProcessInstanceDetailDTO> detail(ProcessInstanceDetailSearchDTO searchDTO);

    /**
     * 详情
     * @param searchDTO ProcessInstanceDetailByTaskSearchDTO
     * @return ProcessInstanceDetailDTO
     */
    BaseResponseDTO<ProcessInstanceDetailDTO> detailByTask(ProcessInstanceDetailByTaskSearchDTO searchDTO);

    /**
     * 加载bpmn图
     * @param dto 发布ID
     * @return BpmnLoadDTO
     */
    BaseResponseDTO<BpmnLoadDTO> loadBpmnByDeployId(BpmnLoadByDeployIdDTO dto);

    /**
     * 加载bpmn图
     * @param dto 发布ID
     * @return BpmnLoadDTO
     */
    BaseResponseDTO<BpmnLoadDTO> loadBpmnByInstanceId(BpmnLoadByInstanceIdDTO dto);

    /**
     * 创建流程实例
     * @param createInstanceDTO ProcessCreateInstanceDTO
     * @return Boolean
     */
    BaseResponseDTO<Boolean> createInstance(ProcessCreateInstanceDTO createInstanceDTO);

    /**
     * 更新实体类信息
     * @param updateDTO 参数
     * @return Boolean
     */
    BaseResponseDTO<Boolean> updateInstance(ProcessInstanceUpdateDTO updateDTO);

    /**
     * 开始流程实例
     * @param startDTO ProcessInstanceStartBO
     * @return Boolean
     */
    BaseResponseDTO<Boolean> startInstance(ProcessInstanceStartDTO startDTO);

    /**
     * 删除流程实例
     * @param deleteDTO ProcessInstanceDeleteDTO
     * @return BaseResponseDTO
     */
    BaseResponseDTO<Boolean> deleteInstance(ProcessInstanceDeleteDTO deleteDTO);

    /**
     * 完成当前任务
     * @param paramDTO 参数
     * @return BaseResponseDTO
     */
    BaseResponseDTO<Boolean> taskFinish(TaskFinishParamDTO paramDTO);

    /**
     * 认领任务
     * @param paramDTO TaskClaimParamDTO
     * @return BaseResponseDTO
     */
    BaseResponseDTO<Boolean> claimTask(TaskClaimParamDTO paramDTO);
}
